package com.ymatou.query.seller.trading.api.parameter.AppResponse;

import java.math.BigDecimal;
import java.util.List;

import net.sf.json.JSONObject;

import com.ymatou.iapi.trading.sellerquery2.parameter.vo.SubProductInfo;
import com.ymttest.database.model.ProductPromotion;
import com.ymttest.utils.DataUtil;

public class SellerOrderProductInfo {
	// Summary:
	// 规格id
	private String CatalogId;
	//
	// Summary:
	// 物流方式：4保税发货，3护航直邮，2海外直邮，1国内现货国内转运
	private int CatalogStatus;
	//
	// Summary:
	// 1:代购; 0:现货
	private int CatalogType;
	//
	// Summary:
	// 平台优惠券商品分摊金额
	private BigDecimal CouponAmount;
	//
	// Summary:
	// 订单折扣商品分摊金额
	private BigDecimal DiscountPartialAmount;
	//
	// Summary:
	// 是否免运费 null:unknown
	private Boolean FreightFree;
	//
	// Summary:
	// 运费商品分摊金额
	private BigDecimal FreightPartialAmount;
	//
	// Summary:
	// 配送方式
	private Integer LogisticsType;
	//
	// Summary:
	// 区分新客价或者VIP价
	private Integer PriceType;
	//
	// Summary:
	// 商品id
	private String ProductId;
	//
	// Summary:
	// 商品数量
	private int ProductNum;
	//
	// Summary:
	// 商品原价
	private BigDecimal ProductOriginalPrice;
	//
	// Summary:
	// 商品图片链接地址
	private String ProductPictureUrl = "";
	//
	// Summary:
	// 商品成交价
	private BigDecimal ProductPrice;
	//
	// Summary:
	// 是否退货
	private boolean ProductRefund;
	//
	// Summary:
	// 退货方式(官方、非官方)
	private Integer ProductRefundChannel;
	//
	// Summary:
	// 商品名称
	private String ProductTitle;
	//
	// Summary:
	// 商品优惠信息
	private ProductPromotion Promotion;
	//
	// Summary:
	// 商品规格信息
	private String PropertyInfo;
	//
	// Summary:
	// 退货退款金额
	private BigDecimal SalesRefundAmount;
	//
	// Summary:
	// 退货退款单号
	private String SalesRefundCode = "";
	//
	// Summary:
	// 退货退款状态
	private int SalesRefundStatus = 0;
	//
	// Summary:
	// 卖家优惠券商品分摊金额
	private BigDecimal SellerCouponAmount;
	//
	// Summary:
	// 是否支持7天无条件退款
	private Boolean SupportRtnWithoutReason;
	//
	// Summary:
	// 交税方
	private Integer TariffType;

	/**
	* 是否PSP商品
	*/
	private boolean pspProduct;

	/**
	 * 组合商品
	 */
	private List<SubProductInfo> SubProductInfos;

	public String getCatalogId() {
		return CatalogId;
	}

	public void setCatalogId(String catalogId) {
		CatalogId = catalogId;
	}

	public int getCatalogStatus() {
		return CatalogStatus;
	}

	public void setCatalogStatus(int catalogStatus) {
		CatalogStatus = catalogStatus;
	}

	public int getCatalogType() {
		return CatalogType;
	}

	public void setCatalogType(int catalogType) {
		CatalogType = catalogType;
	}

	public BigDecimal getCouponAmount() {
		return CouponAmount;
	}

	public void setCouponAmount(BigDecimal couponAmount) {
		CouponAmount = couponAmount;
	}

	public BigDecimal getDiscountPartialAmount() {
		return DiscountPartialAmount;
	}

	public void setDiscountPartialAmount(BigDecimal discountPartialAmount) {
		DiscountPartialAmount = discountPartialAmount;
	}

	public Boolean getFreightFree() {
		return FreightFree;
	}

	public void setFreightFree(Boolean freightFree) {
		FreightFree = freightFree;
	}

	public BigDecimal getFreightPartialAmount() {
		return FreightPartialAmount;
	}

	public void setFreightPartialAmount(BigDecimal freightPartialAmount) {
		FreightPartialAmount = freightPartialAmount;
	}

	public Integer getLogisticsType() {
		return LogisticsType;
	}

	public void setLogisticsType(Integer logisticsType) {
		LogisticsType = logisticsType;
	}

	public Integer getPriceType() {
		return PriceType;
	}

	public void setPriceType(Integer priceType) {
		PriceType = priceType;
	}

	public String getProductId() {
		return ProductId;
	}

	public void setProductId(String productId) {
		ProductId = productId;
	}

	public int getProductNum() {
		return ProductNum;
	}

	public void setProductNum(int productNum) {
		ProductNum = productNum;
	}

	public BigDecimal getProductOriginalPrice() {
		return ProductOriginalPrice;
	}

	public void setProductOriginalPrice(BigDecimal productOriginalPrice) {
		ProductOriginalPrice = productOriginalPrice;
	}

	public String getProductPictureUrl() {
		return ProductPictureUrl;
	}

	public void setProductPictureUrl(String productPictureUrl) {
		ProductPictureUrl = DataUtil.Stringg
				.getValueOrDefault(productPictureUrl);
	}

	public BigDecimal getProductPrice() {
		return ProductPrice;
	}

	public void setProductPrice(BigDecimal productPrice) {
		ProductPrice = productPrice;
	}

	public boolean isProductRefund() {
		return ProductRefund;
	}

	public void setProductRefund(boolean productRefund) {
		ProductRefund = productRefund;
	}

	public Integer getProductRefundChannel() {
		return ProductRefundChannel;
	}

	public void setProductRefundChannel(Integer productRefundChannel) {
		ProductRefundChannel = productRefundChannel;
	}

	public String getProductTitle() {
		return ProductTitle;
	}

	public void setProductTitle(String productTitle) {
		ProductTitle = productTitle;
	}

	public ProductPromotion getPromotion() {
		return Promotion;
	}

	public void setPromotion(ProductPromotion promotion) {
		Promotion = promotion;
	}

	public String getPropertyInfo() {
		return PropertyInfo;
	}

	public void setPropertyInfo(String propertyInfo) {
		PropertyInfo = propertyInfo;
	}

	public BigDecimal getSalesRefundAmount() {
		return SalesRefundAmount;
	}

	public void setSalesRefundAmount(BigDecimal salesRefundAmount) {
		SalesRefundAmount = salesRefundAmount;
	}

	public String getSalesRefundCode() {
		return SalesRefundCode;
	}

	public void setSalesRefundCode(String salesRefundCode) {
		SalesRefundCode = DataUtil.Stringg.getValueOrDefault(salesRefundCode);
	}

	public int getSalesRefundStatus() {
		return SalesRefundStatus;
	}

	public void setSalesRefundStatus(int salesRefundStatus) {
		SalesRefundStatus = salesRefundStatus;
	}

	public BigDecimal getSellerCouponAmount() {
		return SellerCouponAmount;
	}

	public void setSellerCouponAmount(BigDecimal sellerCouponAmount) {
		SellerCouponAmount = sellerCouponAmount;
	}

	public Boolean getSupportRtnWithoutReason() {
		return SupportRtnWithoutReason;
	}

	public void setSupportRtnWithoutReason(Boolean supportRtnWithoutReason) {
		SupportRtnWithoutReason = supportRtnWithoutReason;
	}

	public Integer getTariffType() {
		return TariffType;
	}

	public void setTariffType(Integer tariffType) {
		TariffType = tariffType;
	}

	public boolean equals(SellerOrderProductInfo that) {
		//		return this.toString().equals(that.toString());
		return DataUtil.Json
				.compareJsonObject(this.toString(), that.toString());
	}

	public String toString() {
		//		return JSONObject.fromObject(this).toString();
		//.net的catalogStatus有问题，先不做比对
		JSONObject o = JSONObject.fromObject(this);
		o.remove("CatalogStatus");
		o.remove("SalesRefundCode");
		o.remove("SalesRefundAmount");
		o.remove("catalogStatus");
		o.remove("salesRefundCode");
		o.remove("salesRefundAmount");
		o.remove("subProductInfos");
		return o.toString();
	}

	public boolean isPspProduct() {
		return pspProduct;
	}

	public void setPspProduct(boolean pspProduct) {
		this.pspProduct = pspProduct;
	}

	public List<SubProductInfo> getSubProductInfos() {
		return SubProductInfos;
	}

	public void setSubProductInfos(List<SubProductInfo> subProductInfos) {
		SubProductInfos = subProductInfos;
	}

}
